Remove the `pkgid` arg and replace the `profile` flag with `package`.
authorSondre Lefsaker <sondrele@stud.ntnu.no>
Sat, 2 May 2015 10:19:55 +0000 (12:19 +0200)
committerSondre Lefsaker <sondrele@stud.ntnu.no>
Sat, 2 May 2015 10:19:55 +0000 (12:19 +0200)
src/bin/rustc.rs
tests/test_cargo_rustc.rs

index 72c8ad98da5fd6f324728ff25edc462bb6acdb12..431fffd90d9f96869be45269436226449b1fe63e 100644 (file)
@@ -7,9 +7,8 @@ use cargo::util::{CliResult, CliError, Config};
 
 #[derive(RustcDecodable)]
 struct Options {
-    arg_pkgid: Option<String>,
     arg_opts: Option<Vec<String>>,
-    flag_profile: Option<String>,
+    flag_package: Option<String>,
     flag_jobs: Option<u32>,
     flag_features: Vec<String>,
     flag_no_default_features: bool,
@@ -28,23 +27,23 @@ pub const USAGE: &'static str = "
 Compile a package and all of its dependencies
 
 Usage:
-    cargo rustc [options] [<pkgid>] [--] [<opts>...]
+    cargo rustc [options] [--] [<opts>...]
 
 Options:
-    -h, --help              Print this message
-    -p, --profile PROFILE   The profile to compile for
-    -j N, --jobs N          The number of jobs to run in parallel
-    --lib                   Build only this package's library
-    --bin NAME              Build only the specified binary
-    --example NAME          Build only the specified example
-    --test NAME             Build only the specified test
-    --bench NAME            Build only the specified benchmark
-    --release               Build artifacts in release mode, with optimizations
-    --features FEATURES     Features to compile for the package
-    --no-default-features   Do not compile default features for the package
-    --target TRIPLE         Target triple which compiles will be for
-    --manifest-path PATH    Path to the manifest to fetch depednencies for
-    -v, --verbose           Use verbose output
+    -h, --help               Print this message
+    -p SPEC, --package SPEC  The profile to compile for
+    -j N, --jobs N           The number of jobs to run in parallel
+    --lib                    Build only this package's library
+    --bin NAME               Build only the specified binary
+    --example NAME           Build only the specified example
+    --test NAME              Build only the specified test
+    --bench NAME             Build only the specified benchmark
+    --release                Build artifacts in release mode, with optimizations
+    --features FEATURES      Features to compile for the package
+    --no-default-features    Do not compile default features for the package
+    --target TRIPLE          Target triple which compiles will be for
+    --manifest-path PATH     Path to the manifest to fetch depednencies for
+    -v, --verbose            Use verbose output
 
 The <pkgid> specified (defaults to the current package) will have all of its
 dependencies compiled, and then the package itself will be compiled. This
@@ -68,7 +67,6 @@ pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
     config.shell().set_verbose(options.flag_verbose);
 
     let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
-    let spec = options.arg_pkgid.as_ref().map(|s| &s[..]);
 
     let opts = CompileOptions {
         config: config,
@@ -76,7 +74,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
         target: options.flag_target.as_ref().map(|t| &t[..]),
         features: &options.flag_features,
         no_default_features: options.flag_no_default_features,
-        spec: spec,
+        spec: options.flag_package.as_ref().map(|s| &s[..]),
         exec_engine: None,
         mode: ops::CompileMode::Build,
         release: options.flag_release,
index ccc90e18bd0f11fe74c4951f7a6fca099abfe294..87fd961a5845b4fb7eb960b168e712ec0e0c7dc7 100644 (file)
@@ -43,7 +43,7 @@ test!(build_lib_for_foo {
         "#)
         .file("src/lib.rs", r#" "#);
 
-    assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo"),
+    assert_that(p.cargo_process("rustc").arg("--lib").arg("-v"),
                 execs()
                 .with_status(0)
                 .with_stdout(verbose_output_for_target(true, &p)));
@@ -63,7 +63,7 @@ test!(build_lib_and_allow_unstable_options {
         "#)
         .file("src/lib.rs", r#" "#);
 
-    assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo")
+    assert_that(p.cargo_process("rustc").arg("--lib").arg("-v")
                 .arg("--").arg("-Z").arg("unstable-options"),
                 execs()
                 .with_status(0)
@@ -84,7 +84,7 @@ test!(build_main_and_allow_unstable_options {
             fn main() {}
         "#);
 
-    assert_that(p.cargo_process("rustc").arg("-v").arg("foo")
+    assert_that(p.cargo_process("rustc").arg("-v")
                 .arg("--").arg("-Z").arg("unstable-options"),
                 execs()
                 .with_status(0)